package com.example.lvsuo.mapper;

import com.example.lvsuo.entity.SystemRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lvsuo.entity.vo.SystemRoleVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 系统角色表，给用户分配的角色 Mapper 接口
 * </p>
 *
 * @author 心心念念
 * @since 2021-03-30
 */
@Mapper
public interface SystemRoleMapper extends BaseMapper<SystemRole> {


    void selectlistq(List<Map<String, String>> zhongyao);

    List<SystemRole>getSystemRole(SystemRole systemRole);

    @Insert(" insert into system_role values(null,#{roleName},(select now()),#{roleText},'Y',null) ")
    void instRole(SystemRoleVo sys);

    @Select(" select LAST_INSERT_ID() ")
    String queryInstId();


    void insertRoleOrAuthority(List list);

    List<SystemRoleVo> getSystemRoleId(String id);

    SystemRole getSystemRoleByid(String id);

    List getAuthorityId(String id);


    void updateRole(SystemRoleVo systemRoleVo);

    void deleteRoleOrAuthority(String roleId);

    void deleteRole(String id);

    void deleteRoleAndAuthority(String id);

    List<SystemRole> getSystemRua();

    @Select(" select * from system_role  ")
    List<SystemRole> queryRole();
}
